<load target="css/editor.css" usecdn="true" />
<load target="css/editor_admin.css" usecdn="true" />
<load target="js/editor_admin.js" usecdn="true" />
<h1 class="h1">{$lang->cmd_setup}</h1>
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
	<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form ruleset="setupComponent" action="./" method="post">
	<input type="hidden" name="module" value="editor" />
	<input type="hidden" name="act" value="procEditorAdminSetupComponent" />
	<input type="hidden" name="component_name" value="{$component_name}" />
    <div class="table">
        <table width="100%" border="1" cellspacing="0">
        <tr>
            <th scope="row"><div>{$lang->component_name}</div></th>
            <td>{$component->title}({$component->component_name}) ver. {$component->version}</td>
        </tr>
        <tr>
            <th scope="row"><div>{$lang->component_author}</div></th>
            <td class="blue">
            <!--@foreach($component->author as $author)-->
            {$author->name} (<a href="{$author->homepage}" onclick="window.open(this.href);return false;">{$author->homepage}</a>, <a href="mailto:{$author->email_address}">{$author->email_address}</a>)<br />
            <!--@endforeach-->
            </td>
        </tr>
        <!--@if($component->link)-->
        <tr>
            <th scope="row"><div>{$lang->component_link}</div></th>
            <td><a href="#" onclick="winopen('{$component->link}');return false;">{$component->link}</a></td>
        </tr>
        <!--@end-->

        <!--@foreach($component->extra_vars as $key => $val)-->
        <tr class="row{$cycle_idx}">
            <th scope="row"><div>{$val->title}</div></th>
            <td>
                <input type="text" name="{$key}" value="{$val->value}" />
                <p>{$val->description}</p>
            </td>
        </tr>
        <!--@end-->

        <tr>
            <th scope="row"><div>{$lang->grant}</div></th>
            <td>
            <!--@foreach($group_list as $key => $val)-->
                <input type="checkbox" name="target_group" value="{$key}" <!--@if(in_array($key, $component->target_group))-->checked="checked"<!--@end--> id="group_{$key}"> <label for="group_{$key}">{$val->title}</label> &nbsp;
            <!--@end-->
                <p>{$lang->about_component_grant}</p>
            </td>
        </tr>

        <!--@if($mid_list)-->
            <tr>
                <th scope="row"><div>
                    {$lang->module}
                    <input type="checkbox" onclick="XE.checkboxToggleAll('mid_list'); return false;" />
                </div></th>
                <td>
                    <p>{$lang->about_component_mid}</p>
                    <!--@foreach($mid_list as $module_category_srl => $modules)-->
                        <div class="module_category_title">
                            <input type="checkbox" onclick="XE.checkboxToggleAll('mid_list', { wrap:'section_{$module_category_srl}' }); return false;" />
                        <!--@if($modules->title)-->
                            {$modules->title}
                        <!--@else-->
                            {$lang->none_category}
                        <!--@end-->
                        </div>

                        <div id="section_{$module_category_srl}">
                        <!--@foreach($modules->list as $key => $val)-->
                            <div class="module_list">
                                <input type="checkbox" value="{$key}" name="mid_list" id="chk_mid_list_{$key}" <!--@if(in_array($key, $component->mid_list))-->checked="checked"<!--@end--> />
                                <label for="chk_mid_list_{$key}">{$key} ({$val->browser_title})</label>
                            </div>
                        <!--@end-->
                        </div>
                    <!--@end-->
                </td>
            </tr>
        <!--@end-->

        </table>
    </div>
    <div class="btnArea">
        <span class="btn"><a href="{getUrl('', 'module', 'admin', 'act', 'dispEditorAdminIndex')}" >{$lang->cmd_back}</a></span>
        <span class="btn"><input type="submit" value="{$lang->cmd_apply}" /></span>
    </div>
</form>
